package com.sc.userspringboot.service.impl;

import com.sc.userspringboot.pojo.Comments;
import com.sc.userspringboot.dao.ICommentsDao;
import com.sc.userspringboot.service.ICommentsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 帖子评论及回复表 服务实现类
 * </p>
 *
 * @author user
 * @since 2025-09-19 06:25:46
 */
@Service
public class CommentsServiceImpl extends ServiceImpl<ICommentsDao, Comments> implements ICommentsService {

    @Autowired
    private ICommentsDao commentsDao;

    @Override
    public List<Comments> getByPostId(Integer postId) {
        return commentsDao.getByPostId(postId);
    }

    @Override
    public List<Comments> getByParentCommentId(Integer postId, Integer commentId) {
        return commentsDao.getByParentCommentId(postId, commentId);
    }

    @Override
    public Integer getNumber(Integer postId) {
        return commentsDao.getNumber(postId);
    }
}
